<#include "/layout/layout.ftl">
<#import "/layout/macro.ftl" as macro>
<#import "/layout/select.ftl" as my/>
<#assign css>
	<style>
		/*.child_type{display: none;}*/
	</style>
</#assign>
<#assign js>
<script>


	//tableId,queryId,conditionContainer
	//var userTable;
	$(function() {


	});

	function deal(id) {
		layer.confirm('确定已经处理好此订单了吗?', {}, function (index) {
			$.ajax({
				type: "POST",
				dataType: "json",
				data:{dispatchId: id},
				url: "/orderDispatch/dealRefuse/",
				success: function (res) {
					layer.msg(res.message, {time: 2000}, function () {
						location.reload();
					});
				},
				error:function(res){
					layer.msg("派单失败")
					//alert("派单失败:"+JSON.stringify(res));
				}
			});
		});
	}

</script>
</#assign>
<@layout title="拒接订单记录" active="orderDispatch">
<!-- Content Header (Page header) -->
<section class="content-header">
	<h1>
		拒接订单记录
		<small></small>
	</h1>
	<ol class="breadcrumb">
		<li><a href="/"><i class="fa fa-home"></i> 分站后台</a></li>
		<li><a href="#"><i class="fa fa-list-ul"></i> 订单调度台</a></li>
		<li class="active"><i class="fa fa-table"></i> 拒接订单记录</li>
	</ol>
</section>

<!-- Main content -->
<section class="content">
	<!-- Default box -->
	<div class="box box-primary">
		<div class="box-body">
			<table class="table table-striped">
				<tr>
					<th>主键</th>
					<#--<th>分站ID</th>-->
					<th>订单号</th>
					<th>总金额</th>
					<th>订单类型</th>
					<th>订单子类型</th>
					<#--<th>订单状态</th>-->
					<th>支付类型</th>
					<th>下单时间</th>
					<th>派单时间</th>
					<#--<th>支付时间</th>-->
					<th>师傅ID</th>
					<th>师傅姓名</th>
					<th>师傅电话</th>
					<th>状态</th>
				</tr>
                <#list pageInfo.list as item>
                <tr>
					<td >${item.id!}</td>
					<#--<td >${item.agentId!}</td>-->
					<td >${item.orderNo!}</td>
					<td >${item.amount?string('0.00')!}</td>
					<td >
						<#if item.type??>
							${convert('SERVICE_CLASS',item.type) !}
						</#if>
					</td>
					<td >
						<#if item.type??>
							<#if item.childType??>
								${convert('SERVICE_CLASS',item.type,item.childType) !}
							</#if>
						</#if>
					</td>
					<td >${convert('PAY_TYPE',item.payType) !}</td>
					<#--<td >${convert('ORDER_STATUS',item.status) !}</td>-->
					<td >${item.createAt?string('yyyy-MM-dd HH:mm:ss')!}</td>
					<td >${item.dispatchDate?string('yyyy-MM-dd HH:mm:ss')!}</td>
				<#--	<td >${item.payAt!}</td>-->

					<td>${item.masterId!}</td>
					<td>${item.masterName!}</td>
					<td>${item.masterPhone!}</td>
					<td>
						<#if item.status == 1>
							<a class="btn btn-sm btn-success" href="javascript:deal('${item.dispatchId !}')" data-btn-type="detail">未处理</a>
						<#else>
							${convert('DEAL_STATUS',item.status) !}
						</#if>
					</td>
				</tr>
                </#list>
			</table>
		</div>
		<!-- /.box-body -->
		<div class="box-footer clearfix">
            <@macro.page pageInfo=pageInfo url="/orderDispatch/refuseList?" />
		</div>
	</div>
	<!-- /.box -->

</section>
<!-- /.content -->
</@layout>
